#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from models import db, AdminUser, init_db
from app import app

if __name__ == '__main__':
    # 初始化数据库
    init_db(app)
    
    with app.app_context():
        users = AdminUser.query.all()
        print(f"数据库中共有 {len(users)} 个用户:")
        for user in users:
            print(f"ID: {user.id}, 用户名: {user.username}, 邮箱: {user.email}, 活跃: {user.is_active}, 超级用户: {user.is_superuser}")
            print(f"创建时间: {user.created_at}, 最后登录: {user.last_login}")
            print("-" * 50)